import SendGQL from "@/api/SendGQL";

//更改寺庙
const UpdateTemple = `
  mutation UpdateTemple ($id: String , $temple: templeInPut){
    updateTemple(id: $id , temple: $temple )
  }
`;

export const updateTemple = (id, temple) => {
  return SendGQL({
    query: UpdateTemple,
    variables: {
      id,
      temple,
    },
  });
};

//更改人员信息
const UpdatePerson = `
  mutation UpdatePerson ($id: String , $person: personInPut){
    updatePerson(id: $id , person: $person )
  }
`;

export const updatePerson = (id, person) => {
  return SendGQL({
    query: UpdatePerson,
    variables: {
      id,
      person,
    },
  });
};

//更改线索信息
const UpdateClue = `
  mutation UpdateClue ($id: String , $clue: clueInPut){
    updateClue(id: $id , clue: $clue )
  }
`;

export const updateClue = (id, clue) => {
  return SendGQL({
    query: UpdateClue,
    variables: {
      id,
      clue,
    },
  });
};

//更改涉案物品信息
const UpdateInvolved = `
  mutation UpdateInvolved ($id: String , $involved: involvedInPut){
    updateInvolved(id: $id , involved: $involved )
  }
`;

export const updateInvolved = (id, involved) => {
  return SendGQL({
    query: UpdateInvolved,
    variables: {
      id,
      involved,
    },
  });
};

//更改涉枪涉爆重点人员信息
const UpdatePersonnel = `
  mutation UpdatePersonnel ($id: String , $personnel: personnelInPut){
    updatePersonnel(id: $id , personnel: $personnel )
  }
`;

export const updatePersonnel = (id, personnel) => {
  return SendGQL({
    query: UpdatePersonnel,
    variables: {
      id,
      personnel,
    },
  });
};

//更改涉枪涉爆案件信息
const UpdateGunInvolved = `
  mutation UpdateGunInvolved ($id: String , $gunInvolved: gunInvolvedInPut){
    updateGunInvolved(id: $id , gunInvolved: $gunInvolved )
  }
`;

export const updateGunInvolved = (id, gunInvolved) => {
  return SendGQL({
    query: UpdateGunInvolved,
    variables: {
      id,
      gunInvolved,
    },
  });
};
//更改事故
const UpdateAccident = `
  mutation UpdateAccident ($id: String, $accident: accidentInPut) {
    updateAccident(id: $id, accident: $accident)
  }
`;

export const updateManager = (params) => {
  const { id, accident } = params;
  return SendGQL({
    query: UpdateAccident,
    variables: {
      id,
      accident,
    },
  });
};
//更新治安重点人员
const UpdateSuspects = `
  mutation UpdateSuspects ($id: String, $suspects: suspectsInPut) {
    updateSuspects(id: $id, suspects: $suspects)
  }
`;

export const updateSuspects = (id, suspects) => {
  return SendGQL({
    query: UpdateSuspects,
    variables: {
      id,
      suspects,
    },
  });
};

//更新刑嫌人员
const UpdateSecurity = `
  mutation UpdateSecurity ($id: String, $security: securityInPut) {
    updateSecurity(id: $id, security: $security)
  }
`;

export const updateSecurity = (id, security) => {
  
  return SendGQL({
    query: UpdateSecurity,
    variables: {
      id,
      security,
    },
  });
};

//更新出境回流人员
const UpdateOutbound = `
  mutation UpdateOutbound ($id: String, $outbound: outboundInPut) {
    updateOutbound(id: $id, outbound: $outbound)
  }
`;

export const updateOutbound = (id, outbound) => {
 
  return SendGQL({
    query: UpdateOutbound,
    variables: {
      id,
      outbound,
    },
  });
};

//更新房屋信息
const UpdateHouse = `
  mutation UpdateHouse ($id: String, $house: houseInPut) {
    updateHouse(id: $id, house: $house)
  }
`;

export const updateHouse = (id, house) => {
  return SendGQL({
    query: UpdateHouse,
    variables: {
      id,
      house,
    },
  });
};

//更新方案信息
const UpdatePlan = `
  mutation UpdatePlan ($id: String, $plan: planInPut) {
    updatePlan(id: $id, plan: $plan)
  }
`;

export const updatePlan = (id, plan) => {
  
  return SendGQL({
    query: UpdatePlan,
    variables: {
      id,
      plan,
    },
  });
};

//更新单位控制
const UpdateBusiness = `
  mutation UpdateBusiness ($id: String, $business: businessInPut) {
    updateBusiness(id: $id, business: $business)
  }
`;

export const updateBusiness = (id, business) => {
  
  return SendGQL({
    query: UpdateBusiness,
    variables: {
      id,
      business,
    },
  });
};

//更新重要点位
const UpdatePoints = `
  mutation UpdatePoints ($id: String, $points: pointsInPut) {
    updatePoints(id: $id, points: $points)
  }
`;

export const updatePoints = (id, points) => {
  
  return SendGQL({
    query: UpdatePoints,
    variables: {
      id,
      points,
    },
  });
};

//更新车辆
const UpdateCar = `
  mutation UpdateCar ($id: String, $car: carInPut) {
    updateCar(id: $id, car: $car)
  }
`;

export const updateCar = (id, car ) => {
  
  return SendGQL({
    query: UpdateCar,
    variables: {
      id,
      car
    },
  });
};

//更改佛寺活动
const UpdateActivity = `
  mutation UpdateActivity ($id: String, $activity: activityInPut) {
     updateActivity(id: $id,activity: $activity,)
  }
`;

export const updateActivity = (id, activity) => {
    return SendGQL({
    query: UpdateActivity,
    variables: {
      activity,
      id,
    },
  });
};

//更改矛盾纠纷详情
const UpdateContradiction = `
  mutation UpdateContradiction ($id: String, $contradiction: contradictionInPut) {
    updateContradiction(id: $id, contradiction: $contradiction)
  }
`;

export const updateContradiction = (id, contradiction) => {
  
  return SendGQL({
    query: UpdateContradiction,
    variables: {
      id,
      contradiction,
    },
  });
};

//更改矛盾详情information
const UpdateInformation = `
  mutation UpdateInformation ($id: String, $information: informationInPut) {
    updateInformation(id: $id, information: $information)
  }
`;

export const updateInformation = (id, information) => {
  
  return SendGQL({
    query: UpdateInformation,
    variables: {
      id,
      information,
    },
  });
};

//政保人员SecPersonnel
const UpdateSecPersonnel = `
  mutation UpdateSecPersonnel ($id: String, $secpersonnel: secpersonnelInPut) {
    updateSecPersonnel(id: $id, secpersonnel: $SecPersonnel)
  }
`;

export const updateSecPersonnel = (id, secpersonnel) => {
  
  return SendGQL({
    query: UpdateSecPersonnel,
    variables: {
      id,
      secpersonnel,
    },
  });
};


//更改僧人Monk
const UpdateMonk = `
  mutation UpdateMonk ($id: String, $monk: monkInPut) {
    updateSecMonk(id: $id, monk: $monk)
  }
`;

export const updateMonk = (id, monk) => {

  return SendGQL({
    query: UpdateMonk,
    variables: {
      id,
      monk,
    },
  });
};

//更改管理员Manager
const UpdateManager = `
  mutation UpdateManager ($id: String, $manager: managerInPut) {
    updateSecManager(id: $id, manager: $manager)
  }
`;

export const UpdateManage = (id, manager) => {

  return SendGQL({
    query: UpdateManager,
    variables: {
      id,
      manager,
    },
  });
};

//更改会员Member
const UpdateMember = `
  mutation UpdateMember ($id: String, $member: memberInPut) {
    updateSecManager(id: $id, member: $member)
  }
`;

export const UpdateMembe = (id, member) => {

  return SendGQL({
    query: UpdateMember,
    variables: {
      id,
      member,
    },
  });
};